﻿using UnityEngine;
using System.Collections;

public class BattleMessageCell : MonoBehaviour
{
	[HideInInspector] public int indexPath;
	
	public UIToggle toggle;
	public GameObject counterAttackButton;
	public UILabel titleLabel;
	public UILabel subTitleLabel;
	public UILabel winLabel;
	public UILabel expLabel;
	public UILabel battleResutLabel;
	public UILabel receiveDateLabel;
	public UILabel remainTimeLabel;	
	public UILabel[] memberNameLabelArray;
	public UILabel[] memberExpLabelArray;
	public GameObject[] memberExpIconArray;

	void OnEnable()
	{
		animation["View_message Open"].time = 0.0f;
		animation["View_message Open"].enabled = true;
		animation.Sample();
		animation["View_message Open"].enabled = false;
	}

	public void OnClick_CounterAttack()
	{
		this.GetComponent<UIDragScrollView>().scrollView.GetComponent<BattleMessageScrollView>().sceneManager.CounterAttackProcess(indexPath);
	}
	
	public void OnClick_InvadeFlipOpen()
	{
		this.GetComponent<UIDragScrollView>().scrollView.GetComponent<BattleMessageScrollView>().sceneManager.FlipOpenBattleMessageCell(indexPath);
	}
	
	public void OnClick_InvadeFlipClose()
	{
		this.GetComponent<UIDragScrollView>().scrollView.GetComponent<BattleMessageScrollView>().sceneManager.FlipCloseBattleMessageCell(indexPath);
	}
}